/* OPS.AMIRX -- AutoOP, AutoGreet and AutoKill (Version 3.0) 28/04/96
\\ written by Terminator (Terminator@cybercor.demon.co.uk) IRC: Terminatr
// Please mail any bug reports/comments to the above address with a subject
\\ headder of OPS.AMIRX.
// ** What do I do with the file ** -----» Do this...
\\ Put this script in PROGDIR:rexx/ and add this to your join arexx event
// Ops.Amirx %p
\\
// Many thanks to all the people that have helped me with this and other
\\ arexx programs :)
//
\\ Many thanks to Pulse (Richard Ulrich) for beta testing, and for all others
// who have sent me their ideas. Keep them coming!
\\
*/
/* Config files */
OPS_LIST = "DH1:ops" /* This is the file which contains the users which
should become OPs on joining a channel */
GREETZ_LIST = "DH1:greetz" /* This is the file which contains the users which
should be GREETED on joining a channel */
KILL_LIST ="DH1:Kill" /* This file contains the users who should be KILLED
(Kicked & Banned) on joining a channel. */
/* Notify Modes */
GREET_NOTIFY = "YES" /* This will notify you upon your GREETING of someone*/
OP_NOTIFY = "YES" /* This will notify you when you OP someone automatically */
KILL_NOTIFY = "YES" /* This will notify you when you KILL someone */
/* This part parses all data into variables to be used by the rest of the script */
OPTIONS RESULTS
PARSE ARG SENDER MSGTYPE RECEIVER MESSAGE
PARSE UPPER VAR SENDER '!'LOGINAME'@'BLANK'.'COMPANY
PARSE UPPER VAR SENDER '@'USER_HOST
PARSE UPPER VAR SENDER ':'CHECKNICK'!'
PARSE VAR SENDER ':'USER'!'
PARSE VAR RECEIVER ':'CHANNEL
PARSE UPPER VAR CHANNEL CHANUP
/* Main Script Starts Here */
"getmynick"
my_nick=RESULT
count = 0
namevalid = 0
do while namevalid = 0
getuser count
nick=RESULT
if nick = my_nick then do
getuserstate count
opstat=rc
if rc = 1 then do
mystat="op"
end
namevalid=1
end
count = count + 1
end
/* OPS SECTION */
open(temp, Ops_List, 'R')
DO UNTIL EOF(temp)
ops_this_line = ReadLn(temp)
PARSE UPPER VAR ops_this_line READNICK':'BOD'@'HOST'.'PROVIDER'#'
PARSE UPPER VAR ops_this_line '@'READ_HOST'#'CHAN1'#'CHAN2'#'CHAN3
CHAN1 = "#"CHAN1
CHAN2 = "#"CHAN2
CHAN3 = "#"CHAN3
IF MYSTAT="op" then do
IF READNICK="*" & BOD="*" & HOST="*" & PROVIDER="*" then call OPME
IF READNICK="*" & BOD="*" & HOST="*" & PROVIDER=COMPANY then call OPME
IF READNICK="*" & BOD="*" & HOST=BLANK & PROVIDER="*" then call OPME
IF READNICK="*" & BOD=LOGINAME & HOST="*" & PROVIDER="*" then call OPME
IF READNICK=CHECKNICK & BOD="*" & HOST="*" & PROVIDER="*" then call OPME
IF READNICK="*" & BOD="*" & READ_HOST=USER_HOST & PROVIDER=COMPANY then call OPME
IF READNICK="*" & BOD=LOGINAME & HOST="*" & PROVIDER=COMPANY then call OPME
IF READNICK=CHECKNICK & BOD="*" & HOST="*" & PROVIDER=COMPANY then call OPME
IF READNICK="*" & BOD=LOGINAME & READ_HOST=USER_HOST & PROVIDER="*" then call OPME
IF READNICK=CHECKNICK & BOD=LOGINAME & HOST="*" & PROVIDER="*" then call OPME
IF READNICK=CHECKNICK & BOD="*" & READ_HOST=USER_HOST & PROVIDER="*" then call OPME
IF READNICK=CHECKNICK & BOD=LOGINAME & READ_HOST=USER_HOST & PROVIDER="*" then call OPME
IF READNICK=CHECKNICK & BOD=LOGINAME & HOST="*" & PROVIDER=COMPANY then call OPME
IF READNICK=CHECKNICK & BOD="*" & READ_HOST=USER_HOST & PROVIDER=COMPANY then call OPME
IF READNICK="*" & BOD=LOGINAME & READ_HOST=USER_HOST & PROVIDER=COMPANY then call OPME
IF READNICK=CHECKNICK & BOD=LOGINAME & READ_HOST=USER_HOST & PROVIDER=COMPANY then call OPME
END
END
CLOSE(temp)
/* KILL SECTION */
open(temp, KILL_LIST, 'R')
DO UNTIL EOF(temp)
Kill_this_line = ReadLn(temp)
PARSE UPPER VAR Kill_this_line KREADNICK':'KBOD'@'KHOST'.'KPROVIDER'!'
PARSE UPPER VAR Kill_this_line '@'KREAD_HOST'!'KILLTYPE'#'
PARSE VAR Kill_this_line '#'KILL_MESSAGE
IF MYSTAT="op" then do
IF KREADNICK="*" & KBOD="*" & KHOST="*" & KPROVIDER="*" then call KILLME
IF KREADNICK="*" & KBOD="*" & KHOST="*" & KPROVIDER=COMPANY then call KILLME
IF KREADNICK="*" & KBOD="*" & KHOST=BLANK & KPROVIDER="*" then call KILLME
IF KREADNICK="*" & KBOD="*" & KREAD_HOST=USER_HOST & KPROVIDER=COMPANY then call KILLME
IF KREADNICK="*" & KBOD=LOGINAME & KHOST="*" & KPROVIDER="*" then call KILLME
IF KREADNICK="*" & KBOD=LOGINAME & KHOST="*" & KPROVIDER=COMPANY then call KILLME
IF KREADNICK="*" & KBOD=LOGINAME & KREAD_HOST=USER_HOST & KPROVIDER="*" then call KILLME
IF KREADNICK="*" & KBOD=LOGINAME & KREAD_HOST=USER_HOST & KPROVIDER=COMPANY then call KILLME
IF KREADNICK=CHECKNICK & KBOD="*" & KHOST="*" & KPROVIDER=COMPANY then call KILLME
IF KREADNICK=CHECKNICK & KBOD="*" & KHOST="*" & KPROVIDER="*" then call KILLME
IF KREADNICK=CHECKNICK & KBOD="*" & KREAD_HOST=USER_HOST & KPROVIDER=COMPANY then call KILLME
IF KREADNICK=CHECKNICK & KBOD="*" & KREAD_KHOST=USER_HOST & KPROVIDER="*" then call KILLME
IF KREADNICK=CHECKNICK & KBOD=LOGINAME & KHOST="*" & KPROVIDER="*" then call KILLME
IF KREADNICK=CHECKNICK & KBOD=LOGINAME & KREAD_HOST=USER_HOST & KPROVIDER="*" then call KILLME
IF KREADNICK=CHECKNICK & KBOD=LOGINAME & KHOST="*" & KPROVIDER=COMPANY then call KILLME
IF KREADNICK=CHECKNICK & KBOD=LOGINAME & KREAD_HOST=USER_HOST & KPROVIDER=COMPANY then call KILLME
END
END
CLOSE(temp)
/* GREETZ SECTION */
open(temp, Greetz_List, 'R')
DO UNTIL EOF(temp)
Greetz_this_line = ReadLn(temp)
/* Let's check to see if it's Morning, Afternoon, or Night */
DATA = TIME()
If DATA > '00:00:00' & DATA < '11:59:59' then DATUM = "Mornin'"
If DATA > '12:00:00' & DATA < '17:59:59' then DATUM = "Afternoon"
If DATA > '18:00:00' & DATA < '23:59:59' then DATUM = "Evenin'"
/* These lines define ya greetz */
Greet.1 = "Hiya"
Greet.2 = "Yo!"
Greet.3 = "G'day"
Greet.4 = DATUM /* This line handles the context greeting */
Greet.5 = "Greetings"
Greet.6 = "Hi"
Greet.7 = "Re"
Greet.8 = "Hello"
call RANDOM(,,TIME("S"))
picked = RANDOM(1,8)
GREETING = Greet.picked
PARSE UPPER VAR Greetz_this_line GREADNICK':'GBOD'@'GHOST'.'GPROVIDER'#'
PARSE UPPER VAR Greetz_this_line '@'GREAD_HOST'#'
PARSE VAR Greetz_this_line '#'PERSONAL_MESSAGE
IF PERSONAL_MESSAGE = " " then GREETING = GREETING
IF PERSONAL_MESSAGE ~= " " then GREETING = PERSONAL_MESSAGE
IF GREADNICK="*" & GBOD="*" & GHOST="*" & GPROVIDER="*" then call GREETME
IF GREADNICK="*" & GBOD="*" & GHOST="*" & GPROVIDER=COMPANY then call GREETME
IF GREADNICK="*" & GBOD="*" & GHOST=BLANK & GPROVIDER="*" then call GREETME
IF GREADNICK="*" & GBOD="*" & GREAD_HOST=USER_HOST & GPROVIDER=COMPANY then call GREETME
IF GREADNICK="*" & GBOD=LOGINAME & GHOST="*" & GPROVIDER="*" then call GREETME
IF GREADNICK="*" & GBOD=LOGINAME & GHOST="*" & GPROVIDER=COMPANY then call GREETME
IF GREADNICK="*" & GBOD=LOGINAME & GREAD_HOST=USER_HOST & GPROVIDER="*" then call GREETME
IF GREADNICK="*" & GBOD=LOGINAME & GREAD_HOST=USER_HOST & GPROVIDER=COMPANY then call GREETME
IF GREADNICK=CHECKNICK & GBOD="*" & GHOST="*" & GPROVIDER=COMPANY then call GREETME
IF GREADNICK=CHECKNICK & GBOD="*" & GHOST="*" & GPROVIDER="*" then call GREETME
IF GREADNICK=CHECKNICK & GBOD="*" & GREAD_HOST=USER_HOST & GPROVIDER=COMPANY then call GREETME
IF GREADNICK=CHECKNICK & GBOD="*" & GREAD_GHOST=USER_HOST & GPROVIDER="*" then call GREETME
IF GREADNICK=CHECKNICK & GBOD=LOGINAME & GHOST="*" & GPROVIDER="*" then call GREETME
IF GREADNICK=CHECKNICK & GBOD=LOGINAME & GREAD_HOST=USER_HOST & GPROVIDER="*" then call GREETME
IF GREADNICK=CHECKNICK & GBOD=LOGINAME & GHOST="*" & GPROVIDER=COMPANY then call GREETME
IF GREADNICK=CHECKNICK & GBOD=LOGINAME & GREAD_HOST=USER_HOST & GPROVIDER=COMPANY then call GREETME
END
CLOSE(temp)
EXIT
OPME: PROCEDURE EXPOSE CHANNEL CHAN1 CHAN2 CHAN3 USER OP_NOTIFY CHANUP
DOIT = "YES"
IF (CHANUP = CHAN1 | CHANUP = CHAN2 | CHANUP = CHAN3) then DOIT = "NO"
IF DOIT = "YES" then do
"SAY /op" CHANNEL USER
IF OP_NOTIFY = "YES" then "echo P="d2c(27)"b«AutoOP»" "You have just AUTOPED®" USER
end
RETURN
GREETME: PROCEDURE EXPOSE CHANNEL USER GREET_NOTIFY PERSONAL_MESSAGE GREETING
IF PERSONAL_MESSAGE = " " then "SAY /msg" CHANNEL GREETING USER
IF PERSONAL_MESSAGE ~= " " then "SAY /msg" CHANNEL GREETING
IF GREET_NOTIFY = "YES" & PERSONAL_MESSAGE = " " then "echo P="d2c(27)"b«AutoGreet»" "You have just AUTOGREETED®" USER "with the greeting" GREETING
IF GREET_NOTIFY = "YES" & PERSONAL_MESSAGE ~= " " then "echo P="d2c(27)"b«AutoGreet»" "You have just AUTOGREETED®" USER "with the text" PERSONAL_MESSAGE
RETURN
KILLME: PROCEDURE EXPOSE CHANNEL USER KILL_NOTIFY KILL_MESSAGE KILLTYPE USER_HOST
"SAY /kick" CHANNEL USER KILL_MESSAGE
IF KILLTYPE = "NICK" then "SAY /ban" CHANNEL USER"@"USER_HOST
IF KILLTYPE = "HOST" then "SAY /ban" CHANNEL "*@"USER_HOST
IF KILL_NOTIFY = "YES" & KILL_MESSAGE ~= " " then "echo P="d2c(27)"b«Kick'n'Ban»" "You have AUTOKICK'N'BANNED®" USER "with the message" KILL_MESSAGE
IF KILL_NOTIFY = "YES" & KILL_MESSAGE = " " then "echo P="d2c(27)"b«Kick'n'Ban»" "You have AUTOKICK'N'BANNED®" USER "with your default kick reason."